package com.craftcomputing.client.Header;

import com.craftcomputing.client.Listeners.HeaderListeners.*;
import com.google.gwt.user.client.ui.*;

public class HeaderTab extends Composite {
	public HeaderTab() {
		final HorizontalPanel horizontalPanel_3 = new HorizontalPanel();
		initWidget(horizontalPanel_3);
		horizontalPanel_3.setSize("200px", "25px");
		
		workshopsLabel = new TabLabel("Workshops", "/python/workshops?search=");
		workshopsLabel.addMouseListener(new WorkshopTabMouseListener(this, workshopsLabel, "workshop"));
		horizontalPanel_3.add(workshopsLabel);
		horizontalPanel_3.setCellVerticalAlignment(workshopsLabel, HasVerticalAlignment.ALIGN_MIDDLE);
		workshopsLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		workshopsLabel.setSize("75px", "25px");
		workshopsLabel.setStyleName("navTab");

		materialsLabel = new TabLabel("Materials", "/python/materials?search=");
		materialsLabel.addMouseListener(new MaterialsTabMouseListener(this, materialsLabel, "materials"));
		horizontalPanel_3.add(materialsLabel);
		materialsLabel.setStyleName("navTab");
		horizontalPanel_3.setCellVerticalAlignment(materialsLabel, HasVerticalAlignment.ALIGN_MIDDLE);
		materialsLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		materialsLabel.setSize("75px", "25px");

		themesLabel = new TabLabel("Themes", "/python/themes?search=");
		themesLabel.addMouseListener(new ThemesTabMouseListener(this, themesLabel, "themes"));
		horizontalPanel_3.add(themesLabel);
		themesLabel.setStyleName("navTab");
		horizontalPanel_3.setCellVerticalAlignment(themesLabel, HasVerticalAlignment.ALIGN_MIDDLE);
		themesLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		themesLabel.setSize("75px", "25px");

		codeLabel = new TabLabel("Code", "/python/codesamples?search=");
		codeLabel.addMouseListener(new CodeTabMouseListener(this, codeLabel, "code"));
		horizontalPanel_3.add(codeLabel);
		codeLabel.setStyleName("navTab");
		horizontalPanel_3.setCellVerticalAlignment(codeLabel, HasVerticalAlignment.ALIGN_MIDDLE);
		codeLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		codeLabel.setSize("75px", "25px");
		
	}
	public TabLabel workshopsLabel, materialsLabel, themesLabel, codeLabel; 
	private String current = "";
	private TextBox tb;
	public String getCurrent(){return current;}
	public void setCurrent(String current){
		workshopsLabel.setStyleName("navTab");
		materialsLabel.setStyleName("navTab");
		themesLabel.setStyleName("navTab");
		codeLabel.setStyleName("navTab");		
		this.current = current;
	}
	public TextBox getTextBox(){return tb;}
	public void setSearchBox(TextBox tb){this.tb = tb;}
}
